<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>当当网后台管理系统</title>

<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/admincss/login.css"/>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/ui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/ui/themes/icon.css">
<script type="text/javascript" src="${pageContext.request.contextPath}/ui/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/ui/jquery.serializejson.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/MD5.js"></script>
<script type="text/javascript">
 function login(){
    var name=$("#signup_name").val();
    var pwd=$("#signup_password").val();
    if(name==""||pwd==""){
     alert("用户名或密码为空");
     return null;
    }
     var a=$("#signup_password").val();
     $("#signup_password").val(MD5(a));
	 var fotmata=$('#loginform').serializeJSON();
     $.ajax({
	 url:'${pageContext.request.contextPath}/admin/login',
	 data:fotmata,
	 dataType:'json',
	 type:'post',
	 success:function(res){
		 if(res.success)
		 {
		  location.href='index.jsp';
		 }
		 else {
			 $.messager.alert('提示',res.message,'info');
		 }
	 } 
  })
 
 }
</script>
</head>
<body>
<div class='signup_container'>
<div class="w-load"><div class="spin"></div></div>
    <h1 class='signup_title'>当当网后台管理系统</h1>
    <div id="userInfo">
    	<span style="float:left; margin-left:40px; height:200px; border:0px solid red"><img src='${pageContext.request.contextPath}/images/erp.jpg' id='admin'/></span>
        <span style="float:left; margin-left:40px; height:200px; border:0px solid red">
            <div id="signup_forms" class="signup_forms clearfix">
                        <form class="signup_form_form" id="loginform" method="post" >
                                <div class="form_row first_row">
                                    <label for="signup_email">请输入用户名</label>
                                    <input type="text" name="username" placeholder="请输入用户名" id="signup_name" >
                                </div>
                                <div class="form_row">
                                    <label for="signup_password">请输入密码</label>
                                    <input type="password" name="pwd" placeholder="请输入密码" id="signup_password" >
                                </div>
                       </form>
            </div> 
            <div id="foo"></div>
                	<br/>      
        </span>
    </div>
    
    

    <div class="login-btn-set"><div class='rem'>记住我</div> <a href='javascript:login()' class='login-btn'></a></div>
</div>

</body>



</html>